package pl.vanta.utils.ejb.ejbqlb.parts;

import java.util.LinkedList;
import java.util.Queue;

public class Where
{
	private From<?>			from;

	private Queue<Field>	fields;

	public Where(From<?> from)
	{
		this.from = from;
		this.fields = new LinkedList<Field>();
	}

	public Field FIELD(String name)
	{
		Field f = new Field(this, name);

		this.fields.add(f);

		return f;
	}

	public String getPart()
	{
		StringBuilder sb = new StringBuilder(this.from.getPart());
		sb.append(" WHERE ");

		// TODO dorobic reszte

		return sb.toString();
	}
}